package com.gy.def.service.impl;

import com.gy.def.dataobject.UserTable;
import com.gy.def.repository.UserRepository;
import com.gy.def.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserImpl implements UserService {
  @Autowired
  private UserRepository appUserRepository;

  @Override
  public UserTable save(UserTable userTable) {
    return appUserRepository.save(userTable);
  }

  @Override
  public List<UserTable> findAll() {
    return appUserRepository.findAll();
  }

  @Override
  public UserTable findByUserNameAndUserPwd(String userName, String userPwd) {
    return appUserRepository.findByUserNameAndUserPwd(userName, userPwd);
  }

  @Override
  public UserTable findByUserName(String userName) {
    return appUserRepository.findByUserName(userName);
  }

  @Override
  public UserTable findByUserNameAndUserPwdAndUserType(String userName, String userPwd, Integer userType) {
    return appUserRepository.findByUserNameAndUserPwdAndUserType(userName, userPwd, userType);
  }
}
